package com.xiantm.study.thread.singlethreadexecution;


/**
 * SingleThreadExecution模式
 */
public class SingleThreadExecution {

    public static void main(String[] args) {
        // 多线程方法锁gate对象，只有一个人能通过
        Gate gate = new Gate();

        UserThread lucy = new UserThread("luck", "lali",gate);
        UserThread ask = new UserThread("ask", "alabo",gate);
        UserThread bill = new UserThread("bill", "banama", gate);
        lucy.start();
        ask.start();
        bill.start();
    }
}


